package com.lixinyue.test06;

/**
 * @program: 11.12
 * @description:
 * @author: 李鑫月
 * @create: 2021-11-16 17:18
 **/
class Shape{
    public void draw(){
        System.out.println("draw::");
    }
}
class Flower extends Shape{
    @Override
    public void draw(){
        System.out.println("❀");
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("♦");
    }
}
class Circle extends Shape{
    @Override
    public void draw() {
        System.out.println("●");
    }
}
public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        Rect rect=new Rect();
        Flower flower= new Flower();
        Shape[] shapes={rect,rect,flower,flower};
        for (Shape shape:shapes
             ) {
            shape.draw();
        }
    }
    public static void main2(String[] args) {
        Shape shape=new Rect();
        drawMap(shape);
        Shape shape1= new Flower();
        drawMap(shape1);
    }
    public static void main1(String[] args) {
        Shape shape=new Rect();
        shape.draw();
        Shape shape1= new Flower();
        shape1.draw();

    }

}
